home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1993 / MacHack 1993.toast / MacHack™ 1987-1992 / MacHack™ '92 / Other stuff / Random Utils / PowerBook Thangs / Keys / PowerBook Key Remapping < prev   
Encoding:
Internet Message Format  |  1992-02-17  |  9.2 KB  |  [TEXT/ttxt]

  1. From: Brian Bechtel (2/13/92)
  2. To: Mark Baumwell, Rich Collyer, Colleen Delgadillo, Dennis Hescox, 
  3. Mark B Johnson, Blake Roberts, Kent Sandvik
  4.  
  5. Mail*Link® SMTP               FWD>How to Remap PowerBook Keyboard
  6.  
  7. Greetings
  8.  
  9. Sick of having to change your typing habits every time you move between
  10. your desk machine (Apple Standard Keyboard) and your PowerBook.  Well have
  11. I got a solution for you!
  12.  
  13. The following document describes how you can swap Escape with Backquote
  14. and Slosh with Enter in both hardware and software on your PowerBook
  15. keyboard.  This is version 4 of my document.  The previous versions were
  16. mailed out to individuals.  I'm now sufficiently confident in my 
  17. instructions to post it to the net (and make a *big* fool of myself).
  18.  
  19. The instructions herein are not for the faint hearted.  RedEditting skills
  20. are a must.  Be stout of heart and do the work.  I, for one, have not 
  21. regretted it.
  22.  
  23. Still no news on how to swap Caps Lock and Control.  Sorry.
  24.  
  25. Anyone with any comments should mail me at the address in my signature.
  26.  
  27. Share and Enjoy.
  28.  
  29. Quinn "The Eskimo!"   <quinn@cs.uwa.oz.au>   "Real Coke, Diet .sig"
  30. Department of Computer Science, The University of Western Australia
  31.  
  32. ----------------------------------------------------------------------------
  33.  
  34. Remapping PowerBook Keyboards in Hardware and Software
  35. ------------------------------------------------------
  36.  
  37. by Quinn "The Eskimo" <quinn@cs.uwa.oz.au> 10 Feb 1992
  38.  
  39. 0. Introduction
  40. ---------------
  41.  
  42. For full enjoyment of your new PowerBook you will want to swap
  43. backquote/escape and slosh/enter.  You should do this both in software and
  44. hardware.  The following instructions give you information about how to do
  45. this.  There is also a short spiel on why it's not possible (at the moment)
  46. to swap control and capslock.
  47.  
  48. 0.1 Version History
  49. -------------------
  50.  
  51. Version 4
  52.  
  53. Changes since Version 3.
  54.   o added definite information on the PB140/170 in Section 1.1
  55.   o deleted the waffle saying that I wasn't sure about the PB140/170
  56.  
  57. Changes since Version 2.
  58.   o added the Creeping Legalitis section.
  59.  
  60. Changes since Version 1.
  61.   o added version numbering scheme
  62.   o added section numbering scheme
  63.   o added more warnings changing the KMAP in PowerBook 140/170s
  64.   o added a discussion of the KCAP resource and instructions on how to bash
  65.     it
  66.   o changed the wording in the section on Hardware Remapping
  67.  
  68. 0.2 Disclaimer
  69. --------------
  70.  
  71. All of this work was tested on a Australian PB100 2/20 and an Australian
  72. PB170 4/40 running System Z-7.0.1* (Australian).  Your mileage may vary. 
  73. Please read the Creeping Legalitis section at the end of this document.
  74.  
  75.  
  76. 1. Software Remapping
  77. ---------------------
  78. Warning:  All the usual ResEdit warnings apply.  Please make a copy of your
  79. System file before attempting this procedure.
  80.  
  81. 1.1 Changing the Key Mappings
  82. -----------------------------
  83. a) Open the System file in ResEdit.
  84. b) Open the resource KMAP ID=0 (not KCHR).
  85. c) Change the byte at offset $36 from a $32 to a $35 (backquote to escape)
  86. d) Change the byte at offset $39 from a $35 to a $32 (escape to backquote)
  87. e) Change the byte at offset $38 from a $34 to a $2A (enter to slosh)
  88. f) Change the byte at offset $2E from a $2A to a $34 (slosh to enter)
  89.  
  90. <Start of section for PB100 owners>
  91.  
  92. g) Open the ROv# ID=890.
  93.  
  94. <End of section for PB100 owners>
  95.  
  96. <Start of section for PB140/170 owners>
  97.  
  98. g) Open the ROv# ID=1660
  99.  
  100. <End of section for PB140/170 owners>
  101.  
  102. h) This should open as a template showing fields like 'Version',
  103. 'NumTypes', followed by many entries consisting of 'Type' and 'Res ID'
  104. pairs.
  105.  
  106. [If you do not get a template mail me and I'll send you the appropriate
  107. TMPL resource to install in your ResEdit Preferences file.]
  108.  
  109. i) Select the last set of '*****'.
  110. j) Select 'Insert New Fields' from the Resource menu.
  111. k) Set the type to KMAP and the Res ID to 0
  112. l) Save and close the System file
  113.  
  114.  
  115. 1.2 Changing the Key Cap Description
  116. ------------------------------------
  117. Note:  The instructions in this section will work only if you have a
  118. PowerBook with the US keyboard.  If you have one with the ISO keyboard mail
  119. me and I'll try to help you.
  120.  
  121. a) Open the System file in ResEdit
  122. b) Open the resource KCAP ID=12 (ignore the warning about the resource
  123. being compressed)
  124. c) Change the byte at offset $1B  from a $32 to a $35 (backquote to escape)
  125. d) Change the byte at offset $141 from a $35 to a $32 (escape to backquote)
  126. e) Change the byte at offset $147 from a $34 to a $2A (enter to slosh)
  127. f) Change the byte at offset $69  from a $2A to a $34 (slosh to enter)
  128. g) Save and close the System file
  129.  
  130.  
  131. 1.3 Precautions When Updating Systems
  132. -------------------------------------
  133. Once you have completed this exercise and determined whether it has worked
  134. successfully you should take a copy of the resources you changed and save
  135. them in separate resource file.  This way, when you need to reinstall
  136. system software, you can just paste in these changes.  Be more wary if you
  137. upgrade to a later system.  The KMAP and KCAP resources are unlikely to
  138. change between systems but the ROv# may well do so.  In that case you would
  139. have to change the ROv# again by following steps g) through to k) above.
  140.  
  141.  
  142. 1.4 Theory of Operation
  143. -----------------------
  144. As documented in TN160 there is a resource called the KMAP which maps
  145. physical to virtual keycodes.  This is distinct from the KCHR which maps
  146. virtual keycodes into ASCII characters.  Bashing the KMAP resource is
  147. definitely the correct way of moving keys around the keyboard.  The
  148. following is a list of  keycodes associated with keys that need moving:-
  149.   o backquote 50 $32
  150.   o escape    53 $35
  151.   o slosh     42 $2A
  152.   o enter     52 $34
  153. Normally the keyboard sends down a physical keycode of $32 which is mapped
  154. to the virtual keycode of $32.  My procedure involves bashing the KMAP
  155. resource so that it maps $32 to $35 thereby mapping backquote to escape.  I
  156. do this for each key I wish to remap.
  157.  
  158. In addition there is another resource called the KCAP which is used by the
  159. Key Caps DA to display the physical positioning of the keys on the
  160. keyboard.  This needs to be changed in line with the changes to the KMAP
  161. resource.
  162.  
  163. The only problem remaining is that the PowerBook have a KMAP resource in
  164. ROM that the system uses by default.  I change this by adding an entry to
  165. the ROv# resource stating that the KMAP ID=0 resource in the system file
  166. overrides the KMAP ID=0 resource in the ROM.
  167.  
  168. See Inside Mac V-190 for information about physical and virtual keycodes.
  169. See Technote 160 'Key Mapping' for a description of the format of a KMAP
  170. resource.
  171. See Inside Mac IV-20 for information about the ROv# resource.
  172.  
  173.  
  174. 2. Hardware Remapping
  175. ---------------------
  176. Warning:  The key caps are moderately delicate.  Please use gentle
  177. persuasion (or brute force *with* finesse) to perform this surgery.
  178.  
  179. I did these operation while the PowerBook was on and running.  The reason
  180. for this is simple.  If the PowerBook is in sleep (or off in the case of
  181. the PB100) then messing around with the keys will invariable turn it on. 
  182. If you're squeamish about working on running hardware then you can
  183.   i)  remove the battery (if you own a PB100) OR
  184.   ii) shut down the machine (for PB140/PB170 owners).
  185.  
  186. To remove a key cap...
  187.  
  188. a) Get a couple of lever type things (small flat head screwdrivers are
  189. good).
  190. b) Insert one on each side (ie left and right looking from the front) of
  191. the key cap you wish to remove.
  192. c) Lever up both sides simultaneously.  Be careful that the key cap does
  193. not fly off into hyperspace.  Also be careful that you do not apply too
  194. much force to the surrounding keycaps.
  195.  
  196. To reinsert a key cap...
  197.  
  198. a) Place key cap on key unit
  199. b) Rotate the keycap so that the writing on the cap is the right way up
  200. c) Push down gently until it locks in place
  201.  
  202. Repeat for all the keys you wish to swap.  Obviously only some are
  203. compatible (ie don't go round swapping space and Q :-)
  204.  
  205.  
  206. 3. CapsLock/Control Problems
  207. ----------------------------
  208. At the moment it is not possible to swap capslock/control.  The reason for
  209. this is simple.  When you first press the capslock key it sends only a
  210. keydown event.  When you next press it it only sends a keyup.  This means
  211. that although you can swap capslock and control you end up with a control
  212. key that locks down and a capslock key that doesn't.
  213.  
  214. A number of people at Apple are (informally) chasing up solutions to this
  215. problem.  It may be possible to send the keyboard processor an instruction
  216. to get around the problem.  However no definite solution has been found.
  217.  
  218.  
  219. 4. Creeping Legalitis
  220. ---------------------
  221. (C) Copyright 1992 Jonathan Quinn "The Eskimo!" <quinn@cs.uwa.oz.au>.  This
  222. document may be freely distributed in any way as long as the copyright
  223. notice is retained.
  224.  
  225. Neither the Department of Computer Science nor The University of Western
  226. Australia have anything to do with this document.
  227.  
  228. I take no responsibility for any damage you might do to your hardware or
  229. software by following these instructions.  My only claim is that I followed
  230. them and they worked for me (twice).
  231.  
  232.  
  233. If you have any problems, or feedback in general, feel free to mail me.
  234.  
  235. Please distribute this note to your PowerBooking friends.
  236.  
  237. Share and Enjoy.
  238.  
  239. Quinn "The Eskimo!"   <quinn@cs.uwa.oz.au>   "Real Coke, Diet .sig"
  240. Department of Computer Science, The University of Western Australia
  241.  
  242. ======================================================================
  243.  
  244.